#include <myheader_c_plus.h>
#include <queue>
#include <deque>
using std::list;
using std::deque;
using std::cout;
using std::endl;
using std::queue;
using std::vector;
using std::priority_queue;
void test()
{
    vector<int> vec = {2,234,536,67,8,76,2,32};
    priority_queue<int> number(vec.begin(), vec.end());
    while(!number.empty())
    {
        cout << number.top() << endl;
        number.pop();
    }
    cout << "size = " << number.size() << endl;
}

void test1()
{
    /*
     *
     * vector<int> vec = {2,234,536,67,8,76,2,32};
     * priority_queue<int, vector<int>, std::greater<int>> que;
     * for(size_t idx = 0; idx != vec.size(); ++ idx)
     * {
     *     que.push(vec[idx]);
     *     cout << "push :" << vec[idx] << endl;
     *     cout << "当前队列中优先级最高的元素是：" << que.top() << endl;
     * }
     */
    deque<int> number{2, 3, 6, 8, 9, 1, 4, 7, 5};
    priority_queue<int, vector<int>, std::less<int>> pque;
    for(size_t idx = 0; idx != number.size(); ++idx)
    {
            pque.push(number[idx]);
            cout << "当前优先级队列中，优先级最高的元素是: " << pque.top() << endl;
    }
    while(!pque.empty())
    {
        cout << pque.top() << " ";
        pque.pop();
    }
    cout << endl;

}
int main(int argc, char *argv[])
{
    test1();
    return 0;
}

